/*
 * Created on Jan 12, 2009
 */
package ak.salmon.model;

import java.util.ArrayList;
import java.util.List;

public class DefaultNodeContent implements NodeContent {

    private List<String> lines = new ArrayList<String>();
    private List<String> styles = new ArrayList<String>();
    private Object id;
    private Object parentId;

    public DefaultNodeContent(Object id) {
        this(id, null);
    }

    public DefaultNodeContent(Object id, Object parentId) {
        this.id = id;
        this.parentId = parentId;
    }

    public void addLine(String line, String style) {
        lines.add(line);
        styles.add(style);
    }

    public void addLine(String line) {
        addLine(line, null);
    }

    public Object getId() {
        return id;
    }

    public void setId(Object id) {
        this.id = id;
    }

    public Object getParentId() {
        return parentId;
    }

    public void setParentId(Object parentId) {
        this.parentId = parentId;
    }

    @Override
    public int getNumberOfLines() {
        return lines.size();
    }

    @Override
    public String getLine(int lineNumber) {
        return lines.get(lineNumber);
    }

    @Override
    public String getStyle(int lineNumber) {
        return styles.get(lineNumber);
    }

}
